package mt.client;

import static org.junit.Assert.*;

import mt.client.ClientGUI.Status;
import mt.dummy.ClientCommDummy;

import org.junit.Test;

public class ClientGUITest {

	ClientGUI gui = new ClientGUI();

	@Test
	public void ClientGUITest_IsNumericDouble() {
		String number1 = "3.0";
		assertTrue(gui.isNumericDouble(number1));
		String number2 = "3";
		assertTrue(gui.isNumericDouble(number2));
		String name = "es";
		assertFalse(gui.isNumericDouble(name));
		String number3 = "31 es";
		assertFalse(gui.isNumericDouble(number3));
	}

	@Test
	public void ClientGUITest_IsNumericInteger() {
		String number1 = "3.0";
		assertFalse(gui.isNumericInteger(number1));
		String number2 = "3";
		assertTrue(gui.isNumericInteger(number2));
		String name = "es";
		assertFalse(gui.isNumericInteger(name));
		String number3 = "71 es";
		assertFalse(gui.isNumericDouble(number3));
	}

	@Test
	public void ClientGUITest_ActualizaJanela() {
		fail("Not yet implemented");
	}

	@Test
	public void ClientGUITest_Start() {
		assertNull(gui.getClientComm());
		assertNull(gui.getNickname());
		assertEquals(Status.Disconnect, gui.getSTATUS());
		gui.start(new ClientCommDummy());
		assertNotNull(gui.getClientComm());
		assertNotNull(gui.getNickname());
		assertEquals("es", gui.getNickname());
	}
}
